package com.jjshop.app;

import android.app.Application;
import android.content.Context;
import android.os.Build;
import android.os.StrictMode;

import com.umeng.commonsdk.UMConfigure;
import com.umeng.socialize.PlatformConfig;
import com.umeng.socialize.UMShareAPI;

import static com.jjshop.utils.GlobalContanst.WECHAT_APP_ID;
import static com.jjshop.utils.GlobalContanst.WECHAT_APP_SECRET;

/**
 * Created by ysx on 2018/6/9.
 */
public class JJShopApplication extends Application{

    private static Context mContext;

    @Override
    public void onCreate() {
        super.onCreate();

        mContext = getApplicationContext();

        UMShareAPI.get(this);
        UMConfigure.init(this,"5b13670ba40fa312b80000ea"
                ,"umeng",UMConfigure.DEVICE_TYPE_PHONE,"");//58edcfeb310c93091c000be2 5965ee00734be40b580001a0
        PlatformConfig.setWeixin(WECHAT_APP_ID, WECHAT_APP_SECRET);
//        PlatformConfig.setQQZone(TENCENT_APP_ID, TENCENT_APP_KEY);
//        Config.DEBUG = true;
        //解决android N（>=24）系统以上分享 路径为file://时的 android.os.FileUriExposedException异常
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
            StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
            StrictMode.setVmPolicy(builder.build());
        }

    }

    public static Context getContext() {
        return mContext;
    }

}
